﻿@using CoreData
@using System.Text.RegularExpressions
@model IEnumerable<Merchant_Payment>
@if (Model!=null && Model.Count() > 0)
{
    var i = 0;
    <table cellpadding="0" cellspacing="0" width="100%" class="table" id="tSortablemerchantPayment">
        <thead>
            <tr>
                <th width="20px">
                </th>
                <th width="100px">Noney</th>
                <th width="70px">Date of payment</th>
                 <th width="50px">Description</th>
                <th width="60px">Action
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                i++;
                <tr>
                    <td width="20px">
                        @i
                        <span class="SpanId" style="display: none;">@item.ID</span>
                    </td>
                    <td width="70px">
                        @Helper.StringHelper.FormatCurrencyUS(item.Money)
                    </td>
                  
                    <td width="75px">
                        @item.DateOfPayment.ToShortDateString()
                    </td>
                  <td width="75px">
                        @item.Description
                    </td>
                  
                    <td width="60px">
                    
                      @if (Helper.SessionManagement.Value("pvalue").Contains("D"))
                      {
                        
                        <a title="Delete" href="@Url.Action("Delete", "MerchantPaymentManagement", new { id = item.ID })" class="icon-trash" onclick="return confirm('Do you want delete this merchant ?');"></a>
                          
                      }
                    </td>
                </tr>
            }
        </tbody>
    </table>
}
else
{
    <h2 class="error-text">Not any merchant payment transaction here.
    </h2>
}